package com.new_wear.project.system.integral.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.new_wear.project.system.integral.mapper.CstUserIntegralMapper;
import com.new_wear.project.system.integral.domain.CstUserIntegral;
import com.new_wear.project.system.integral.service.ICstUserIntegralService;
import com.new_wear.common.utils.text.Convert;

/**
 * 用户 - 积分(等、消)Service业务层处理
 * 
 * @author new_wear
 * @date 2019-12-31
 */
@Service
public class CstUserIntegralServiceImpl implements ICstUserIntegralService 
{
    @Autowired
    private CstUserIntegralMapper cstUserIntegralMapper;

    /**
     * 查询用户 - 积分(等、消)
     * 
     * @param uid 用户 - 积分(等、消)ID
     * @return 用户 - 积分(等、消)
     */
    @Override
    public CstUserIntegral selectCstUserIntegralById(Long uid)
    {
        return cstUserIntegralMapper.selectCstUserIntegralById(uid);
    }

    /**
     * 查询用户 - 积分(等、消)列表
     * 
     * @param cstUserIntegral 用户 - 积分(等、消)
     * @return 用户 - 积分(等、消)
     */
    @Override
    public List<CstUserIntegral> selectCstUserIntegralList(CstUserIntegral cstUserIntegral)
    {
        return cstUserIntegralMapper.selectCstUserIntegralList(cstUserIntegral);
    }

    /**
     * 新增用户 - 积分(等、消)
     * 
     * @param cstUserIntegral 用户 - 积分(等、消)
     * @return 结果
     */
    @Override
    public int insertCstUserIntegral(CstUserIntegral cstUserIntegral)
    {
        return cstUserIntegralMapper.insertCstUserIntegral(cstUserIntegral);
    }

    /**
     * 修改用户 - 积分(等、消)
     * 
     * @param cstUserIntegral 用户 - 积分(等、消)
     * @return 结果
     */
    @Override
    public int updateCstUserIntegral(CstUserIntegral cstUserIntegral)
    {
        return cstUserIntegralMapper.updateCstUserIntegral(cstUserIntegral);
    }

    /**
     * 删除用户 - 积分(等、消)对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCstUserIntegralByIds(String ids)
    {
        return cstUserIntegralMapper.deleteCstUserIntegralByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户 - 积分(等、消)信息
     * 
     * @param uid 用户 - 积分(等、消)ID
     * @return 结果
     */
    @Override
    public int deleteCstUserIntegralById(Long uid)
    {
        return cstUserIntegralMapper.deleteCstUserIntegralById(uid);
    }
}
